#pragma once

#include "U7FileDefs.h"

// CChunkDoc document

class CChunkDoc : public CDocument
{
	DECLARE_DYNCREATE(CChunkDoc)

private:
	PBYTE m_pChunkFile;
	LONG m_lChunkFileLength;
	int m_nChunkCount;

public:
	int GetChunkCount() const { return m_nChunkCount; }
	PSHAPEID GetChunk( int nChunkIndex ) const
	{
		return (PSHAPEID)(m_pChunkFile + sizeof(CHUNK) * nChunkIndex );
	}

public:
	CChunkDoc();
	virtual ~CChunkDoc();
#ifndef _WIN32_WCE
	virtual void Serialize(CArchive& ar);   // overridden for document i/o
#endif
#ifdef _DEBUG
	virtual void AssertValid() const;
#ifndef _WIN32_WCE
	virtual void Dump(CDumpContext& dc) const;
#endif
#endif

protected:
	virtual BOOL OnNewDocument();

	DECLARE_MESSAGE_MAP()
public:
	virtual void DeleteContents();
};
